<!DOCTYPE html>
<html>
<head>
	<meta charset="UTF-8">
	<meta name="viewport" content="width=device-width">
	<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no">
	<title>意见反馈</title>
</head>
<style>
	input,button,select,textarea{padding:0;margin:0;padding-left: 3%;}
	input{
		background:none;

		outline:none;
		border:0px;
	}
	.fk{margin-bottom:10px;}
	:-moz-placeholder { /* Mozilla Firefox 4 to 18 */
		color: #6c6c6c;
	}

	::-moz-placeholder { /* Mozilla Firefox 19+ */
		color: #6c6c6c;
	}

	input:-ms-input-placeholder,
	textarea:-ms-input-placeholder {
		color: #6c6c6c;
	}

	input::-webkit-input-placeholder,
	textarea::-webkit-input-placeholder {
		color: #6c6c6c;
	}
</style>
<script src="http://lib.sinaapp.com/js/jquery/1.9.1/jquery-1.9.1.min.js"></script>
<script>





    $(function(){
        $("input[name='lianxi']").blur(function () {

//            alert();

            if($("input[name='lianxi']").val() == ''){
                $("input[name='lianxi']").attr('placeholder', '不能为空');
//                $("input[name='lianxi']").css('color', 'red');
                $("input[name='lianxi']").focus();

            }

            if($("input[name='neirong']").val() == ''){
                $("input[name='neirong']").attr('placeholder', '不能为空');
//                $("input[name='lianxi']").css('color', 'red');
                $("input[name='neirong']").focus();

            }

        });

        $("input[name='name']").blur(function () {

//            alert();

            if($("input[name='name']").val() == ''){
                $("input[name='name']").attr('placeholder', '不能为空');
//                $("input[name='lianxi']").css('color', 'red');
                $("input[name='name']").focus();

            }

        });

        $("textarea[name='neirong']").blur(function () {

            if($("input[name='neirong']").val() == ''){
                $("input[name='neirong']").attr('placeholder', '不能为空');
//                $("input[name='lianxi']").css('color', 'red');
                $("input[name='neirong']").focus();

            }

        });







        $('#submit').click(function(){

            var lianxi = $("input[name='lianxi']").val();
            var name = $("input[name='name']").val();
            var neirong = $("textarea[name='neirong']").val();
//            if (lianxi == '' || name == '' || neirong == '') {
//                alert(123);die;
//			}

            $.ajax({
                type: "POST",
                url: "http://www.shierdao.net/v1/users/fankui",
                data: {'lianxi':lianxi, 'name':name, 'neirong':neirong},
                dataType: "json",
                success: function(data){
                    if(data['code'] == 1){
                        alert('提交内容不能为空');
                    }
                    if(data['code'] == 301){
                        alert('内部错误');
                    }
                    if(data['code'] == 200){
                        alert(' 提交成功');
                        $('#form')[0].reset();

                    }
                }
            });
        });
    });



</script>
<body>

<!--<h3 style="text-align:center">意见反馈</h3>-->

<div class="fk">
	<form id="form">
		<input  type="text" style="width:97%;height:30px;border:1px solid #c3c3c3;border-radius: 5px;
-mo-border-radius: 5px; -webkit-border-radius: 5px;color:#353535" name="lianxi" placeholder="请输入您的手机号、用户名"/>

</div>
<div class="fk">
	<input  type="text" style="width:97%;height:30px;border:1px solid #c3c3c3;border-radius: 5px;
-mo-border-radius: 5px; -webkit-border-radius: 5px;color:#666" name="name"  placeholder="主要问题名称"/>
</div>
<div class="fk">
	<textarea name="neirong" style="width:97%;min-height:80px;border-bottom: 1px solid #c3c3c3; padding-top: 3%"></textarea>


</div>
<div style="margin-top:1%">
	<input id="submit" type="button" value="提交" style="width:97%;height:30px;list-style-type:none; background:#1e4ae6;border-radius: 10px;
-mo-border-radius: 10px; -webkit-border-radius: 10px;color:#fff;"/>
</div>
</form>
</body>
</html>
